package com.work.practice;

import org.junit.Test;

import java.util.*;

public class p1 {
    @Test
    public void test1() {
        List<Object> list = Collections.synchronizedList(new ArrayList<>());
        Map<String, Object> map = Collections.synchronizedMap(new HashMap<String, Object>());
        HashSet<Object> set = new HashSet<>();
        LinkedHashMap<Object, Object> hashMap = new LinkedHashMap<>();
        Integer a;
//        ConcurrentHashMap
    }

    @Test
    public void test2() {
        HashSet<Object> hashSet = new HashSet<>();
        boolean isAdded = hashSet.add(1);
        boolean isAdded2 = hashSet.add(1);
        System.out.println(isAdded);//true
        System.out.println(isAdded2);//false,说明后面重复的元素不会添加进去，也不是覆盖更新的逻辑
    }
}
